package com.linkgie.galaxyframework.utils;

public class ApplicationException extends RuntimeException implements ErrorMessage{
	
	private static final long serialVersionUID = 2496508954623401477L;
	
	private Integer code;

	@Override
	public Integer getCode() {
		return code;
	}
	
	public ApplicationException() {
	}
	
	public ApplicationException(String message) {
		super(message);
	}
	
	public ApplicationException(Throwable cause) {
		super(cause.getMessage(), cause);
	}
	
	public ApplicationException(String message, Throwable cause) {
		super(message, cause);
	}
	
	public ApplicationException(int code, String message) {
		super(message);
		this.code = Integer.valueOf(code);
	}
	
	
	public ApplicationException(int code, Throwable cause) {
		super(cause.getMessage(), cause);
		this.code = Integer.valueOf(code);
	}
	
	
	public ApplicationException(int code, String message, Throwable cause) {
		super(message, cause);
		this.code = Integer.valueOf(code);
	}
	
	public ApplicationException(RuntimeStatus status) {
		super(status.DESCRIPTION);
		this.code = status.CODE;
	}
	
	
	public ApplicationException(RuntimeStatus status, String message) {
		super(message);
		this.code = status.CODE;
	}
	
	
	public ApplicationException(RuntimeStatus status, Throwable cause) {
		super(cause.getMessage(), cause);
		this.code = status.CODE;
	}
	
	
	public ApplicationException(RuntimeStatus status, String message, Throwable cause) {
		super(message, cause);
		this.code = status.CODE;
	}
	
	
	

}
